home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesJ-M.lzh / Menace.lha / MenaceHD / Install next >
Text File  |  2001-05-03  |  3KB  |  169 lines

  1. ;****************************
  2. (set #sub-dir "")
  3. (set #readme-file "Menace.readme")    ;name of readme file
  4. (set #last-file "Disk.1")
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. (procedure P_disk
  22.   (askdisk
  23.     (dest #AD_disk)
  24.     (prompt ("\nInsert Menace disk in any drive !"))
  25.     (help @askdisk-help)
  26.   )
  27. )
  28.  
  29. (if
  30.   (exists #readme-file)
  31.   (if 
  32.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  33.     ("")
  34.     (run ("SYS:Utilities/More %s" #readme-file))
  35.   )
  36. )
  37.  
  38. (set #program "WHDLoad")
  39. (P_chkrun)
  40.  
  41. (set #program "RawDIC")
  42. (P_chkrun)
  43.  
  44. (if
  45.   (= @user-level 2)
  46.   (
  47.     (set #CI_drive
  48.       (askchoice
  49.     (prompt "Select source drive for diskimages")
  50.     (default 0)
  51.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  52.     (help @askchoice-help)
  53.       )
  54.     )
  55.     (select #CI_drive
  56.       (set #CI_drive "DF0:")
  57.       (set #CI_drive "DF1:")
  58.       (set #CI_drive "DF2:")
  59.       (set #CI_drive "DF3:")
  60.     )
  61.   )
  62.   (set #CI_drive "DF0:")
  63. )
  64.  
  65. (set @default-dest
  66.   (askdir
  67.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  68.     (help @askdir-help)
  69.     (default @default-dest)
  70.     (disk)
  71.   )
  72. )
  73. (set #dest (tackon @default-dest @app-name))
  74. (if
  75.   (exists #dest)
  76.   (
  77.     (set #choice
  78.       (askbool
  79.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  80.         (default 1)
  81.         (choices "Delete" "Skip")
  82.         (help @askbool-help)
  83.       )
  84.     )
  85.     (if
  86.       (= #choice 1)
  87.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  88.     )
  89.   )
  90. )
  91.  
  92. (makedir #dest
  93.   (help @makedir-help)
  94.   (infos)
  95. )
  96.  
  97. (if
  98.   (exists ("%s.newicon" @app-name))
  99.   (set #icon
  100.     (askchoice
  101.       (prompt "\nWhich icon do you like to install ?\n")
  102.       (default 0)
  103.       (choices "Normal" "NewIcon")
  104.       (help @askchoice-help)
  105.     )
  106.   )
  107.   (set #icon 0)
  108. )
  109. (select #icon
  110.   (set #icon ("%s.inf" @app-name))
  111.   (set #icon ("%s.newicon" @app-name))
  112. )
  113. (copyfiles
  114.   (help @copyfiles-help)
  115.   (source #icon)
  116.   (newname ("%s.info" @app-name))
  117.   (dest #dest)
  118. )
  119. (copyfiles
  120.   (help @copyfiles-help)
  121.   (source ("%s.slave" @app-name ))
  122.   (dest #dest)
  123. )
  124. (if
  125.   (exists #readme-file)
  126.   (copyfiles
  127.     (help @copyfiles-help)
  128.     (source #readme-file)
  129.     (dest #dest)
  130.   )
  131. )
  132. (if
  133.   (exists ("%s.info" #readme-file))
  134.   (copyfiles
  135.     (help @copyfiles-help)
  136.     (source ("%s.info" #readme-file))
  137.     (dest #dest)
  138.   )
  139. )
  140.  
  141. (if
  142.   (= #sub-dir "")
  143.   ("")
  144.   (
  145.     (set #dest (tackon #dest #sub-dir))
  146.     (makedir #dest
  147.       (help @makedir-help)
  148.     )
  149.   )
  150. )
  151.  
  152. (copyfiles
  153.   (help @copyfiles-help)
  154.   (source ("%s.islave" @app-name))
  155.   (dest #dest)
  156. )
  157.  
  158. (working)
  159. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s IGNOREERRORS\nDelete %s.islave" #dest @app-name #CI_drive @app-name))
  160.  
  161. (if
  162.   (exists (tackon #dest #last-file))
  163.   ("")
  164.   (abort "Diskimaging not successful !\nRawDIC was unable to create all needed files !")
  165. )
  166.  
  167.  
  168. (exit)
  169.